A set of data tables often includes foreign-key relationships between individual data tables. Foreign-key relationships are an important class of relationships in the set. Foreign-key relationships are used to represent a many-to-one relationship and are useful to capture hierarchies of the data. For instance, data relating to sales can be organized by region, such as Region->Sales or by time, such as Year->Month->Date->Sales. Common examples of foreign-key relationships are star schemas and snowflake schemas. In a star schema there is a fact table that contains details (e.g. sales transactions) and is connected to other dimension tables (e.g. Customer, Country, Year, Store) via foreign-key relationships. A snowflake schema is similar to a star schema except that the dimension tables could be organized in hierarchies.
In certain cases, the foreign-key (FK) relationships among tables may not be declared or known a priori. In other instances, foreign-key relationships may be lost when data is moved, such as when the data is exported from one format and input into another format. In such cases, either the user has to manually identify the foreign-key relationships or the user has to accept diminished data analysis relative to the data.